import axios from '@/https/axios'
import { queryParams } from '@/hooks/queryParams'

// 商品列表
export function getOrderList(page, query = {}) {
    let r = queryParams(query)
    return axios.get(`admin/order/${page}${r}`)
}

// 删除商品
export function deleteOrder(ids) {
    return axios.post(`/admin/order/delete_all`, {
        ids,
    })
}

// 导出商品列表Excel表格
export function exportOrder(query = {}) {
    let r = queryParams(query)
    return axios.post(`admin/order/excelexport${r}`, {}, {
        responseType: 'blob',
    })
}


export function getShipInfo(id) {
    return axios.get(`/admin/order/${id}/get_ship_info`)
}

export function refundOrder(id, data) {
    return axios.post(`/admin/order/${id}/handle_refund`, data)
}